package zxq.rollcall.course.controller.action;

import io.swagger.annotations.ApiOperation;
import org.springframework.http.MediaType;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import zxq.rollcall.course.entity.dto.ResultDTO;
import zxq.rollcall.course.entity.dto.set.CollegeDTO;
import zxq.rollcall.course.entity.query.CollegeQuery;
import zxq.rollcall.course.entity.query.PageQuery;

import java.util.List;

@Transactional
public interface ICollegeController {

    /**
     * 存储班级信息
     * @param collegeQuery 部门信息
     * @return
     */
    @PostMapping(value = "/save",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "存储部门信息",notes = "存储部门信息")
    @ResponseBody
    ResultDTO<Boolean> save(CollegeQuery collegeQuery);

    /**
     * 修改部门信息
     * @param id 部门id
     * @param collegeQuery 部门信息
     * @return
     */
    @PostMapping(value = "/update",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "修改部门信息",notes = "修改部门信息")
    @ResponseBody
    ResultDTO<Boolean> update(Integer id,CollegeQuery collegeQuery);

    /**
     * 删除部门信息
     * @param id 部门id
     * @return
     */
    @PostMapping(value = "/delete",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "删除部门信息",notes = "删除部门信息")
    @ResponseBody
    ResultDTO<Boolean> delete(Integer id);

    /**
     * 查询部门信息
     * @param pageQuery 页码信息
     * @return
     */
    @GetMapping(value = "/query",produces = MediaType.APPLICATION_JSON_VALUE)
    @ApiOperation(value = "查询部门信息",notes = "查询部门信息")
    @ResponseBody
    ResultDTO<List<CollegeDTO>> query(PageQuery pageQuery);

}
